package com.review.reviewsb.schedule;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.Random;

/**
 * @program: reviewSb
 * @description: 定时统计订单
 * @author: YaoZhiLi
 * @create: 2021-07-05 22:42
 */

@Component
public class VideoOrderTask {
//    @Scheduled(fixedRate = 2000)
    @Scheduled(cron = "*/1 * * * * *")
    public void sum(){
        //正常情况查询数据库
        System.out.println(LocalDateTime.now()+"当前交易额="+new Random().ints(100,10000).findFirst().getAsInt());
    }
}